<html>
<head>
	<link type="text/css" rel="stylesheet" href="../css/default.css" />
    <link type="text/css" rel="stylesheet" href="../js/rainbow/themes/sunburst.css">
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
</head>
<body>
	<div class="page">
<h2>IgeTileMapStack2d <span>CLASS</span></h2>
<p>Declared in <a href="../../engine/core/IgeTileMapStack2d.js">IgeTileMapStack2d.js</a></p>
<div class="itemBox">
	<div class="header">Description</div>
	<div class="content">Tile maps provide a way to align mounted child objects to a tile-based grid. NOTE: These are not to be confused with IgeTextureMap's which allow you to paint a bunch of tiles to a grid.</div>
</div>
<!--=if{extends}[-->
<div class="itemBox">
	<div class="header">Extends</div>
	<div class="content"><a href="IgeEntity.html">IgeEntity</a></div>
</div>
<!--=if{extends}]-->
<h2>Methods</h2><a name="drawGrid"></a>
<h3 class="methodTitle">drawGrid</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Gets / sets the number of grid cells that the tile map should paint to the context during the tick method.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">drawGrid</span>({<span class="argType"></span>} <span class="argName">val</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType"></span>}<span class="argName">val</span> </li></ul></div>
    <div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
    
</div><a name="highlightOccupied"></a>
<h3 class="methodTitle">highlightOccupied</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Gets / sets the flag that determines if the tile map will paint the occupied tiles with an overlay colour so that it is easy to spot them.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">highlightOccupied</span>({<span class="argType"></span>} <span class="argName">val</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType"></span>}<span class="argName">val</span> </li></ul></div>
    <div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
    
</div><a name="tileWidth"></a>
<h3 class="methodTitle">tileWidth</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Gets / sets the map's tile width.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">tileWidth</span>({<span class="argType">Number</span>} <span class="argName">val</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">val</span> Tile width.</li></ul></div>
    <div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
    
</div><a name="tileHeight"></a>
<h3 class="methodTitle">tileHeight</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Gets / sets the map's tile height.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">tileHeight</span>({<span class="argType">Number</span>} <span class="argName">val</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">val</span> Tile height.</li></ul></div>
    <div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
    
</div><a name="_objectOccupyTile"></a>
<h3 class="methodTitle">_objectOccupyTile</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Attached to objects that are mounted to the tile sheet. Adds the object to the tile map at the passed tile co-ordinates. If no tile co-ordinates are passed, will use the array returned from calling overTiles() and will add the object to each tile the object is "over".</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">_objectOccupyTile</span>({<span class="argType">Number</span>} <span class="argName">x</span>, {<span class="argType">Number</span>} <span class="argName">y</span>, {<span class="argType">Number</span>} <span class="argName">width</span>, {<span class="argType">Number</span>} <span class="argName">height</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">x</span> </li><li>{<span class="argType">Number</span>}<span class="argName">y</span> </li><li>{<span class="argType">Number</span>}<span class="argName">width</span> </li><li>{<span class="argType">Number</span>}<span class="argName">height</span> </li></ul></div>
    <div class="methodReturnDesc"></div>
    
</div><a name="_objectUnOccupyTile"></a>
<h3 class="methodTitle">_objectUnOccupyTile</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Attached to objects that are mounted to the tile sheet. Removes the object from the tile map at the passed tile co-ordinates. If no tile co-ordinates are passed, will use the array returned from calling overTiles() and will remove the object from each tile the object is "over".</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">_objectUnOccupyTile</span>({<span class="argType">Number</span>} <span class="argName">x</span>, {<span class="argType">Number</span>} <span class="argName">y</span>, {<span class="argType">Number</span>} <span class="argName">width</span>, {<span class="argType">Number</span>} <span class="argName">height</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">x</span> </li><li>{<span class="argType">Number</span>}<span class="argName">y</span> </li><li>{<span class="argType">Number</span>}<span class="argName">width</span> </li><li>{<span class="argType">Number</span>}<span class="argName">height</span> </li></ul></div>
    <div class="methodReturnDesc"></div>
    
</div><a name="_objectOverTiles"></a>
<h3 class="methodTitle">_objectOverTiles</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Attached to objects that are mounted to the tile sheet. This method returns an array of tile co-ordinates that the object is currently over, calculated using the current world co-ordinates of the object as well as it's 3d geometry.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">_objectOverTiles</span>()</div>
    <div class="methodArgs"></div>
    <div class="methodReturnDesc">Returns {<span class="argType">Array</span>} The array of tile co-ordinates as IgePoint instances.</div>
    
</div><a name="occupyTile"></a>
<h3 class="methodTitle">occupyTile</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Sets a tile or area as occupied by the passed obj parameter. Any previous data on the specified tile or area will be removed.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">occupyTile</span>({<span class="argType">Number</span>} <span class="argName">x</span>, {<span class="argType">Number</span>} <span class="argName">y</span>, {<span class="argType">Number</span>} <span class="argName">width</span>, {<span class="argType">Number</span>} <span class="argName">height</span>, {<span class="argType">*</span>} <span class="argName">obj</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">x</span> </li><li>{<span class="argType">Number</span>}<span class="argName">y</span> </li><li>{<span class="argType">Number</span>}<span class="argName">width</span> </li><li>{<span class="argType">Number</span>}<span class="argName">height</span> </li><li>{<span class="argType">*</span>}<span class="argName">obj</span> </li></ul></div>
    <div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
    
</div><a name="unOccupyTile"></a>
<h3 class="methodTitle">unOccupyTile</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Removes all data from the specified tile or area.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">unOccupyTile</span>({<span class="argType">Number</span>} <span class="argName">x</span>, {<span class="argType">Number</span>} <span class="argName">y</span>, {<span class="argType">Number</span>} <span class="argName">width</span>, {<span class="argType">Number</span>} <span class="argName">height</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">x</span> </li><li>{<span class="argType">Number</span>}<span class="argName">y</span> </li><li>{<span class="argType">Number</span>}<span class="argName">width</span> </li><li>{<span class="argType">Number</span>}<span class="argName">height</span> </li></ul></div>
    <div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
    
</div><a name="isTileOccupied"></a>
<h3 class="methodTitle">isTileOccupied</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Returns true if the specified tile or tile area has an occupied status.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">isTileOccupied</span>({<span class="argType">Number</span>} <span class="argName">x</span>, {<span class="argType">Number</span>} <span class="argName">y</span>, {<span class="argType">Number</span>} <span class="argName">width</span>, {<span class="argType">Number</span>} <span class="argName">height</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">x</span> </li><li>{<span class="argType">Number</span>}<span class="argName">y</span> </li><li>{<span class="argType">Number</span>}<span class="argName">width</span> </li><li>{<span class="argType">Number</span>}<span class="argName">height</span> </li></ul></div>
    <div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
    
</div><a name="pointToTile"></a>
<h3 class="methodTitle">pointToTile</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Returns the tile co-ordinates of the tile that the point's world co-ordinates reside inside.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">pointToTile</span>({<span class="argType"></span>} <span class="argName">point</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType"></span>}<span class="argName">point</span> </li></ul></div>
    <div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
    
</div><a name="mouseTileWorldXY"></a>
<h3 class="methodTitle">mouseTileWorldXY</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Returns the world co-ordinates of the tile the mouse is currently over.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">mouseTileWorldXY</span>()</div>
    <div class="methodArgs"></div>
    <div class="methodReturnDesc">Returns {<span class="argType">IgePoint</span>} </div>
    
</div><a name="mouseToTile"></a>
<h3 class="methodTitle">mouseToTile</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Returns the tile co-ordinates of the tile the mouse is currently over.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">mouseToTile</span>()</div>
    <div class="methodArgs"></div>
    <div class="methodReturnDesc">Returns {<span class="argType">IgePoint</span>} </div>
    
</div><a name="_calculateMousePosition"></a>
<h3 class="methodTitle">_calculateMousePosition</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Sets the internal mouse position data based on the current mouse position relative to the tile map.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">_calculateMousePosition</span>()</div>
    <div class="methodArgs"></div>
    <div class="methodReturnDesc"></div>
    
</div>	</div>
    <script type="text/javascript">
        $(function () {
            $('code').attr('data-language', 'javascript');
        });
    </script>
    <script type="text/javascript" src="../js/rainbow/rainbow-custom.min.js"></script>
</body>
</html>